package hikari.utils;

import com.gooddies.wiring.annotations.Wire;
import com.gooddies.wiring.annotations.WiringComponent;
import hikari.managers.Manager3D;

/**
 * @author sad
 */
@WiringComponent(singleton = true, lazy = true)
public class RenderingStopper {
    @Wire
    Manager3D manager3D;
    public void stopRendering(Runnable runnable) {
        manager3D.stopRenderingTimer();
        try {
            runnable.run();
        } finally {
            manager3D.startRenderingTimer();
        }
    }
}
